package com.example.ujsfish.model;

public class MyPoint {
     Float currentX;
     Float currentY;

    @Override
    public String toString() {
        return "MyPoint{" +
                "currentX=" + currentX +
                ", currentY=" + currentY +
                '}';
    }

    public MyPoint(String currentX, String currentY) {
        if(currentX.charAt(0) == 'E'){
            this.currentY = Float.parseFloat(currentX.substring(1));
        }else if (currentX.charAt(0) == 'W'){
            this.currentY = -Float.parseFloat(currentX.substring(1));
        }

        if(currentY.charAt(0) == 'N'){
            this.currentX = Float.parseFloat(currentY.substring(1));
        }else if (currentY.charAt(0) == 'S'){
            this.currentX = -Float.parseFloat(currentY.substring(1));
        }

    }

    public MyPoint(Float currentX, Float currentY) {
        this.currentX = currentX;
        this.currentY = currentY;
    }

    public void setCurrentX(Float currentX) {
        this.currentX = currentX;
    }

    public void setCurrentY(Float currentY) {
        this.currentY = currentY;
    }

    public Float getCurrentX() {
        return currentX;
    }

    public Float getCurrentY() {
        return currentY;
    }
}

